articles

Home / DeveloperSection / Articles / A Reliable Step-by-step Guide To Create A Git Repository for An Open-Source Project

A Reliable Step-by-step Guide To Create A Git Repository for An Open-Source Project

Navdeep Dadwal804 27-Aug-2019

So, you have finally signed up GitHub! This baby step will bring you to the tremendous benefits that you have not even imagined before. You are now definitely ready for your first git repository, and here we go!

The process is quite simple, and you can easily crack the way to create the Git Repository. Putting you forward to the step by step guide to help you create it easily.

Have a look!

Before these steps, go through what git exactly is and what purpose does it serve for you!

A Reliable Step-by-step Guide To Create A Git Repository for An Open-Source Project

What is Git Repository?

Git is worldwide used and most reliable source considered by the developers for version control. It manages the set of files, projects, and stores the information in a structured manner in the git repository. Linus Torvalds developed it in the year 2005.

It successfully permits you to save all the codes securely within it. These codes can be accessed, managed, and tracked anytime you want. So here, you can keep the collection of your files, projects, codes protected. You get virtual storage along with the folder, .git that holds all the information intact.  

If, however, you get screwed up git repository and spy for its solutions, then several git hacks and tricks are available to smooth out an open source project.
Create Your First, Git Repository!

So, are you ready? Within just 10 minutes, you will have your own Git repository for an open-source project. Just follow these steps:

1.    Click the Fork Button

On the top right of the page, you will find ‘Fort’ button. Click on it, and it will instantly create repository copy in your account.

2.    Download the Repository

Now clone or download the repository to your system by clicking on Clone button. After that, tap on ‘Copy to clipboard’ icon.

Now open a terminal. Run this git command here,

Git clone “URL you just copied”

This step will help you obtain and copy the URL.

3.    Create A Branch

Here you will create a branch by using the command,

Git checkout –b <add-your-name>

This git checkout command will lead you to create a new branch. Assuredly, the name you are deciding about the branch by adding a reasonable thing to it. There is no need to use the word that’s already added in it, but yes, it should surely manifest the purpose of the branch you are going to create.

4.    Essential Changes

In several cases, the user needs to perform some changes. For that, open the file, contributors.md in the text editor. Here add up your name to it and after that save this file.

To see the changes, you can execute the git status command in the project directory. In the branch that you have just created, add all these changes to it with the command,

Git add contributors. md

As you have added the changes, now it turns to commit those changes. For this, use command,

Git commit –m “Add <your-name> to Contributors list"

5.    Push These Changes

Now its time to push these changes to Github. For this use,

Git push origin <add-your-name>

After that use, replacing <add-your-name> by writing the branch name that you have created earlier.

6.    Submit All Changes

Go to Git repository that you have created. Find here the ‘Compare & Pull Request’ button. Tap on this button. Now click on submit option.

All the changes will get merged with the master branch, and you will soon be notified with an email after these changes get merged.

You’re Done!


Finally, you have developed the required skills for open source projects and git repository. You can build your repository quickly by following this guide.

We hope this space has served its purpose of providing you precise & useful information. For more details, stay connected!



Leave Comment

Comments

Liked By